<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" th:href="@{/css/app.css}">
    <link rel="stylesheet" th:href="@{/css/iconfont.css}">
    <link rel="stylesheet" th:href="@{/css/table.css}">
    <title>Blog</title>
</head>
<body>
    <div class="headBar">
        <div class="headBar-items">
            <div class="headBar-item">
                <a th:href="@{'/user/'+${uid}+'/addCategory'}">新增分栏</a>
            </div>
            <div class="headBar-item">
                <a th:href="@{'/user/'+${uid}+'/categories'}">所有分栏</a>
            </div>
        </div>
    </div>
    <div class="content">
        <div class="content-data">
            <table class="pure-table pure-table-horizontal">
                <thead>
                    <tr>
                        <th>value</th>
                        <th>blog</th>
                        <th>introduction</th>
                        <th>option</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td th:text="${defaultCategory.value}"></td>
                        <td th:text="${defaultCategory.blog}"></td>
                        <td th:text="${defaultCategory.introduction}"></td>
                        <td>
                        </td>
                    </tr>
                    <tr th:each="category:${categories}">
                        <td th:text="${category.value}"></td>
                        <td th:text="${category.blog}"></td>
                        <td th:text="${category.introduction}"></td>
                        <td>
                            <a th:href="@{'/user/'+${uid}+'/updateCategory?cid='+${category.id}}">update</a>
                            <a th:href="@{'/user/'+${uid}+'/category/'+${category.id}+'/delete'}">delete</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</body>
</html>